import request from '@/utils/request'

// 查询商品类别列表
export function listCategory(query) {
    return request({
        url: '/stock/category/list',
        method: 'get',
        params: query
    })
}

// 查询商品类别详细
export function getCategory(id) {
    return request({
        url: '/stock/category/' + id,
        method: 'get'
    })
}

// 新增商品类别
export function addCategory(data) {
    return request({
        url: '/stock/category',
        method: 'post',
        data: data
    })
}

// 修改商品类别
export function updateCategory(data) {
    return request({
        url: '/stock/category',
        method: 'put',
        data: data
    })
}

// 删除商品类别
export function delCategory(ids) {
    return request({
        url: '/stock/category/' + ids,
        method: 'delete'
    })
}

// 导出商品类别
export function exportCategory(query) {
    return request({
        url: '/stock/category/export',
        method: 'get',
        params: query
    })
}

// 查询商品类别下拉树结构
export function treeselect() {
    return request({
        url: '/stock/category/optionselect',
        method: 'get'
    })
}